// 引入封装好的request
import request  from "@/utils/request";

// 注册请求
export const register = (data)=>{
    return request({
        url:'/users/register',
        method:'POST',
        data:data
    })
}
// 登录请求
export const login = (data)=>{
    return request({
        url:'/users/login',
        method:'POST',
        data:data
    })
}
// 获取用户信息
export const getUserInfo = ()=>{
    return request({
        url:'/users/getinfo',
        method:'GET',
    })
}

// 退出登录
export const logout = ()=>{
    return request({
        url:'/users/logout',
        method:'GET',
    })
}

// 修改用户名
export const resetusername = (data)=>{
    return request({
        url:'/users/resetusername',
        method:'POST',
        data
    })
}

// 修改密码
export const resetPwd = (data)=>{
    return request({
        url:'/users/resetpwd',
        method:'POST',
        data
    })
}

// 删除上传头像
export const delUploadImg = (data)=>{
    return request({
        url:'/upload/delavatarupload',
        method:'POST',
        data
    })
}

// 确认上传头像
export const resetAvatar = (data)=>{
    return request({
        url:'/users/resetavatar',
        method:'POST',
        data
    })
}